#include "Clock.h"

#include <assert.h>
#include <windows.h>

namespace EngineLib {
	double Clock::_frequency = 0.0;
	
	void Clock::StartUp(void)
	{
		LARGE_INTEGER li;
		QueryPerformanceFrequency(&li);
		Clock::_frequency = (double)li.QuadPart;
	}

	void Clock::ShutDown(void)
	{
	}

	double Clock::GetSecond(void)
	{
		assert(Clock::_frequency > 0);
		LARGE_INTEGER li;
		QueryPerformanceCounter(&li);
		return (double)(li.QuadPart) / Clock::_frequency;
	}

}